<template>
    <span :class="statusClass">{{statusText}}</span>
</template>

<script lang="ts" setup>
    import { reactive, computed } from 'vue'
    const props = defineProps([
        'status'
    ])

    const data = reactive({
        statusText: "",
        statusClass: ""
    })

    // 状态文字
    const statusText = computed(() => {
        switch (props.status) {
            case "IN_PROGRESS":
                return "进行中";
            case "COMPLETED":
                return "已完成";
            default:
                return "未知";
        }
    })

    // 状态样式
    const statusClass = computed(()=> {
        switch (props.status) {
            case "IN_PROGRESS":
                return "inProgress";
            case "COMPLETED":
                return "completed";
            default:
                return "";
        }
    })

</script>

<style scoped>
.inProgress{
    background-color: #95D475;
    padding: 2px 10px;
    border-radius: 10px;
}
.completed{
    background-color: #c8c9cc;
    padding: 2px 10px;
    border-radius: 10px;
}
</style>